package com.gc.cscott.domain.contest;

import com.gc.cscott.domain.contest.numbers.TestCaseNumber;


/**
 *
 * @author root
 */
public class TestCase {
    transient Task task;
    TestCaseNumber number;
    Long timeout;
    Integer score;

    public Integer getScore() {
        if (score==null){
            if (task!=null){
                return task.getDefaultScore();
            } else {
                return 1;
            }
        } else {
            return score;
        }
    }

    public Task getTask() {
        return task;
    }

    public void setTask(Task task) {
        this.task = task;
    }


    public TestCaseNumber getNumber() {
        return number;
    }

    public long getTimeout() {
        if (timeout==null){
            return task.getTimeout();
        } else {
            return timeout;
        }
    }

}
